package zb.stream;

import java.util.Objects;

/**
 * @author wzby
 * @Date: 2022/8/5 17:05
 */
public class User {
    private String name;
    private int id;
    private int age;
    public User() {

    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof User)) return false;
        User user = (User) o;
        return id == user.id && age == user.age && Objects.equals(name, user.name);
    }
    public boolean show(){
        return this.id % 2 == 0;
    }

    @Override
    public int hashCode() {
        return Objects.hash(getName(),getId(),getAge());
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", id=" + id +
                ", age=" + age +
                '}';
    }

public User(String name,int id,int age){
        this.name = name;
        this.id = id;
        this.age = age;
}
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
